﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace JESAI.AutoMapper.Extensions
{
    public static class AutoMapExtensions
    {
        public static TDestination MapTo<TDestination>(this object source)
        {
            return EmulateAutoMapper.Mapper != null ? EmulateAutoMapper.Mapper.Map<TDestination>(source) : default(TDestination);
        }

        public static TDestination MapTo<TSource, TDestination>(this TSource source, TDestination destination)
        {
            return EmulateAutoMapper.Mapper != null ? EmulateAutoMapper.Mapper.Map(source, destination) : default(TDestination);
        }     
    }
}
